home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / Exec / tasks.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  3KB  |  116 lines

  1. #ifndef EXEC_TASKS_H
  2. #define EXEC_TASKS_H 1
  3. /*
  4. ** tasks.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/02/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for tasks.h
  17. */
  18. #ifndef StackSwapStructPtr
  19. #define StackSwapStructPtr ADDRESS
  20. #endif
  21. #ifndef TaskPtr
  22. #define TaskPtr ADDRESS
  23. #endif
  24. /*
  25. ** End of StructPointer defines for tasks.h
  26. */
  27.         
  28. #ifndef EXEC_NODES_H
  29. #include <exec/nodes.h>
  30. #endif /* EXEC_NODES_H */
  31.  
  32. #ifndef EXEC_LISTS_H
  33. #include <exec/lists.h>
  34. #endif /* EXEC_LISTS_H */
  35.  
  36.  
  37.  
  38. /* Please use Exec functions to modify task structure fields,  where available.
  39.  */
  40. STRUCT Task  
  41.     Node tc_Node 
  42.     BYTE    tc_Flags 
  43.     BYTE    tc_State 
  44.     BYTE    tc_IDNestCnt        /* intr disabled nesting*/
  45.     BYTE    tc_TDNestCnt        /* task disabled nesting*/
  46.     LONGINT   tc_SigAlloc         /* sigs allocated */
  47.     LONGINT   tc_SigWait      /* sigs we are waiting for */
  48.     LONGINT   tc_SigRecvd         /* sigs we have received */
  49.     LONGINT   tc_SigExcept        /* sigs we will take excepts for */
  50.     SHORTINT   tc_TrapAlloc        /* traps allocated */
  51.     SHORTINT   tc_TrapAble         /* traps enabled */
  52.     ADDRESS    tc_ExceptData       /* points to except data */
  53.     ADDRESS    tc_ExceptCode       /* points to except code */
  54.     ADDRESS    tc_TrapData         /* points to trap data */
  55.     ADDRESS    tc_TrapCode         /* points to trap code */
  56.     ADDRESS    tc_SPReg            /* stack pointer        */
  57.     ADDRESS    tc_SPLower      /* stack lower bound    */
  58.     ADDRESS    tc_SPUpper      /* stack upper bound + 2*/
  59.     ADDRESS   tc_Switch      /* task losing CPU    */
  60.     ADDRESS   tc_Launch      /* task getting CPU  */
  61.     _List tc_MemEntry        /* Allocated memory. Freed by RemTask() */
  62.     ADDRESS    tc_UserData         /* For use by the task  no restrictions! */
  63. END STRUCT 
  64.  
  65. /*
  66.  * Stack swap structure as passed to StackSwap()
  67.  */
  68. STRUCT  StackSwapStruct  
  69.     ADDRESS    stk_Lower   /* Lowest byte of stack */
  70.     LONGINT   stk_Upper   /* Upper end of stack (size + Lowest) */
  71.     ADDRESS    stk_Pointer     /* Stack pointer at switch point */
  72. END STRUCT 
  73.  
  74. /*----- Flag Bits ------------------------------------------*/
  75. #define TB_PROCTIME 0
  76. #define TB_ETASK    3
  77. #define TB_STACKCHK 4
  78. #define TB_EXCEPT   5
  79. #define TB_SWITCH   6
  80. #define TB_LAUNCH   7
  81.  
  82. #define TF_PROCTIME (1&)
  83. #define TF_ETASK    (8&)
  84. #define TF_STACKCHK (16&)
  85. #define TF_EXCEPT   (32&)
  86. #define TF_SWITCH   (64&)
  87. #define TF_LAUNCH   (128&)
  88.  
  89. /*----- Task States ----------------------------------------*/
  90. #define TS_INVALID  0
  91. #define TS_ADDED    1
  92. #define TS_RUN      2
  93. #define TS_READY    3
  94. #define TS_WAIT 4
  95. #define TS_EXCEPT   5
  96. #define TS_REMOVED  6
  97.  
  98. /*----- Predefined Signals -------------------------------------*/
  99. #define SIGB_ABORT  0
  100. #define SIGB_CHILD  1
  101. #define SIGB_BLIT   4   /* Note: same as SINGLE */
  102. #define SIGB_SINGLE 4   /* Note: same as BLIT */
  103. #define SIGB_INTUITION  5
  104. #define SIGB_NET    7
  105. #define SIGB_DOS    8
  106.  
  107. #define SIGF_ABORT  (1&)
  108. #define SIGF_CHILD  (2&)
  109. #define SIGF_BLIT   (16&)
  110. #define SIGF_SINGLE (16&)
  111. #define SIGF_INTUITION  (32&)
  112. #define SIGF_NET    (128&)
  113. #define SIGF_DOS    (256)
  114.  
  115. #endif  /* EXEC_TASKS_H */
  116.